//Cristian Moral Martos

package Ejercicio01;

import java.io.IOException;
import utils.ImagePGM;

/**
 * Exercise 1.1 Implement two functions that read a file with an image in pgm
 * format and that return, respectively, the greatest and smallest pixel values.
 * 
 * imMaxValue (imageIn) // it returns the greatest value of imageIn imMinValue
 * (imageIn) // it returns the smallest value of imageIn
 * 
 * Note: 'imageIn' denotes the name of the image file.
 * 
 * To check your functions, the greatest and smallest values of image
 * 'cam_74.pgm' are 255 and 4. And the greatest and smallest values of image
 * 'gran01_64.pgm' are 255 and 0.
 * 
 */
public class Ejercicio11 {

	public static void main(String[] args) throws IOException {
		String path = "input\\cam_74.pgm";
		ImagePGM prueba = new ImagePGM(path);
		System.out.println("El valor maximo de la imagen " + path + " es: "
				+ prueba.maxPixelValue());
		System.out.println("El valor minimo de la imagen " + path + " es: "
				+ prueba.minPixelValue());

		System.out.println();

		path = "input\\gran01_64.pgm";
		prueba = new ImagePGM(path);
		System.out.println("El valor maximo de la imagen " + path + " es: "
				+ prueba.maxPixelValue());
		System.out.println("El valor minimo de la imagen " + path + " es: "
				+ prueba.minPixelValue());
	}
}
